package org.cerberus.platform.components;

import static org.cerberus.platform.api.PlatformUtilities.*;

import org.cerberus.platform.ClientIDs;
import org.cerberus.platform.api.PAttribute;
import org.cerberus.platform.api.PComponent;
import org.cerberus.platform.api.PEvent;

@PComponent(classID=ClientIDs.WINDOW, 
		root=true)
public class PWindow {

	@PAttribute
	private String title;
	
	@PAttribute
	private String subTitle;

	@PAttribute
	private PView contentView;
	
	@PAttribute
	private PActionBar actionBar;
	
	public PWindow() {
		actionBar = new PActionBar();
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
		change(this, "title");
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
		change(this, "subTitle");
	}
	
	public PView getContentView() {
		return contentView;
	}

	public void setContentView(PView contentView) {
		this.contentView = contentView;
		change(this, "contentView");
	}
	
	public PActionBar getActionBar() {
		return actionBar;
	}

	public void setActionBar(PActionBar actionBar) {
		this.actionBar = actionBar;
		change(this, "actionBar");
	}

	@PEvent
	public void onOpen() {
		// default implementation does nothing
	}
	
	@PEvent
	public void onClose() {
		
	}
	
}
